package com.ccys.cms.service.userManagement.impl;


import com.ccys.cms.service.userManagement.TblPlanBenefitMemberWebService;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.userManagement.TblPlanBenefitMemberDTO;
import com.ccys.db.entity.TblCdmpBenefit;
import com.ccys.db.entity.TblPlanBenefit;
import com.ccys.db.entity.TblPlanBenefitMember;
import com.ccys.db.mapper.TblCdmpBenefitMapper;
import com.ccys.db.mapper.TblEapMapper;
import com.ccys.db.mapper.TblPlanBenefitMapper;
import com.ccys.db.mapper.TblPlanBenefitMemberMapper;
import com.ccys.db.page.PageUtils;
import com.ccys.db.rely.service.impl.BaseServiceImpl;
import com.ccys.db.vo.userManagement.*;

import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;


/**
 * 关联 benefit 的用户管理
 */
@Service
@Slf4j
public class TblPlanBenefitMemberWebServiceImpl extends BaseServiceImpl<TblPlanBenefitMember> implements TblPlanBenefitMemberWebService {

    @Autowired(required = false)
    private TblPlanBenefitMemberMapper tblPlanBenefitMemberMapper;
    @Autowired(required = false)
    private TblPlanBenefitMapper tblPlanBenefitMapper;

    @Autowired(required = false)
    private TblEapMapper tblEapMapper;
    @Autowired(required = false)
    private TblCdmpBenefitMapper tblCdmpBenefitMapper;

    @Override
    public ResponseResult listObjectsCms(HttpServletRequest request, HttpServletResponse response, TblPlanBenefitMemberDTO dto) {
        List<MemberPlanListWebVO> list = this.tblPlanBenefitMemberMapper.listObjectsCms(dto);
        return ResponseResult.success(list);
    }



    @Override
    public ResponseResult listBenefitEAP(HttpServletRequest request, HttpServletResponse response, TblPlanBenefitMemberDTO dto) {
        List<MemberBenefitsEAPListWebVO> list = this.tblEapMapper.listBenefitEAP(dto);
        return ResponseResult.success(list);
    }

    @Override
    public ResponseResult listBenefitCDMP(HttpServletRequest request, HttpServletResponse response, TblPlanBenefitMemberDTO dto) {
        List<MemberBenefitsCDMPListWebVO> list = this.tblCdmpBenefitMapper.listBenefitCDMP(dto);
        return ResponseResult.success(list);
    }

    @Override
    public ResponseResult listBenefitSubscription(HttpServletRequest request, HttpServletResponse response, TblPlanBenefitMemberDTO dto) {
        List<MemberBenefitSubscriptionListWebVO> list = this.tblPlanBenefitMapper.listBenefitSubscription(dto);
        return ResponseResult.success(list);
    }


}